/*
 * Author  : Pallab
 * Program : sukoban.cxx
 *
 * 2011-12-28 01:06:31
 * I have not failed, I have just found 10000 ways that won't work.
 * http://mcpc.cigas.net/archives/2011/mcpc2011/sokoban/sokoban.html
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define foR(i1,st,ed) for(int i1 = st , j1 = ed ; i1 < j1 ; ++i1 )
#define fo(i1,ed) foR( i1 , 0 , ed )
#define foE(i1,st,ed) foR( i1, st, ed+1 )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )


int kase=1;
int R,C;
string command;
char G[20][20];
char Q[20][20];
char M[20][20];

inline void Read() {
    fo(i,R) {
        fo(j,C) {
            cin>>G[i][j];
            Q[i][j] = isalpha( G[i][j] ) && isupper( G[i][j] ) ? '+' : G[i][j] ;
        }
    }
    cin>>command;
}
inline void debug() {
    fo(i,R) {
        fo(j,C) {
            cout<<G[i][j];
        }
        cout<<"\n";
    }
    cout<<"\n";
}
inline pair<int,int> findWorker() {
    fo(i,R) {
        fo(j,C) {
            if ( tolower(G[i][j])=='w' ) {
                return mk(i,j);
            }
        }
    }
}

inline void moveU(pair<int,int> &P) {
    int r = P.f;
    int c = P.s;
    if ( r-1>=0 && G[r-1][c]=='.' ) {
        G[r][c]='.';
        G[r-1][c]='w';
        P = mk(r-1,c);
        return ;
    }
    if ( r-1>=0 && G[r-1][c]=='+' ) {
        G[r][c]='.';
        G[r-1][c]='w';
        P = mk(r-1,c);
        return ;
    }
    if ( r-1>=0 && r-2>=0 ) {
        if ( tolower(G[r-1][c]) == 'b' && G[r-2][c]=='.' ) {
            G[r][c]='.';
            G[r-1][c]='w';
            G[r-2][c]='b';
            P = mk(r-1,c);
            return ;
        }
    }
    if ( r-1>=0 && r-2>=0 ) {
        if ( tolower(G[r-1][c]) == 'b' && G[r-2][c]=='+' ) {
            G[r][c]='.';
            G[r-1][c]='w';
            G[r-2][c]='b';
            P = mk(r-1,c);
            return ;
        }
    }
}
inline void moveD(pair<int,int> &P) {
    int r = P.f;
    int c = P.s;
    if ( r+1>=0 && G[r+1][c]=='.' ) {
        G[r][c]='.';
        G[r+1][c]='w';
        P = mk(r+1,c);
        return ;
    }
    if ( r+1>=0 && G[r+1][c]=='+' ) {
        G[r][c]='.';
        G[r+1][c]='w';
        P = mk(r+1,c);
        return ;
    }
    if ( r+1>=0 && r+2>=0 ) {
        if ( tolower(G[r+1][c]) == 'b' && G[r+2][c]=='.' ) {
            G[r][c]='.';
            G[r+1][c]='w';
            G[r+2][c]='b';
            P = mk(r+1,c);
            return ;
        }
    }
    if ( r+1>=0 && r+2>=0 ) {
        if ( tolower(G[r+1][c]) == 'b' && G[r+2][c]=='+' ) {
            G[r][c]='.';
            G[r+1][c]='w';
            G[r+2][c]='b';
            P = mk(r+1,c);
            return ;
        }
    }
}
inline void moveL(pair<int,int> &P ) {
    int r = P.f;
    int c = P.s;
    if ( c-1>=0 && G[r][c-1]=='.' ) {
        G[r][c]='.';
        G[r][c-1]='w';
        P = mk(r,c-1);
        return ;
    }
    if ( c-1>=0 && G[r][c-1]=='+' ) {
        G[r][c]='.';
        G[r][c-1]='w';
        P = mk(r,c-1);
        return ;
    }
    if ( c-1>=0 && c-2>=0 ) {
        if ( tolower(G[r][c-1]) == 'b' && G[r][c-2]=='.' ) {
            G[r][c]='.';
            G[r][c-1]='w';
            G[r][c-2]='b';
            P = mk(r,c-1);
            return ;
        }
    }
    if ( c-1>=0 && c-2>=0 ) {
        if ( tolower(G[r][c-1]) == 'b' && G[r][c-2]=='+' ) {
            G[r][c]='.';
            G[r][c-1]='w';
            G[r][c-2]='b';
            P = mk(r,c-1);
            return ;
        }
    }
}
inline void moveR(pair<int,int> &P ) {
    int r = P.f;
    int c = P.s;
    if ( c+1>=0 && G[r][c+1]=='.' ) {
        G[r][c]='.';
        G[r][c+1]='w';
        P = mk(r,c+1);
        return ;
    }
    if ( c+1>=0 && G[r][c+1]=='+' ) {
        G[r][c]='.';
        G[r][c+1]='w';
        P = mk(r,c+1);
        return ;
    }
    if ( c+1>=0 && c+2>=0 ) {
        if ( tolower(G[r][c+1]) == 'b' && G[r][c+2]=='.' ) {
            G[r][c]='.';
            G[r][c+1]='w';
            G[r][c+2]='b';
            P = mk(r,c+1);
            return ;
        }
    }
    if ( c+1>=0 && c+2>=0 ) {
        if ( tolower(G[r][c+1]) == 'b' && G[r][c+2]=='+' ) {
            G[r][c]='.';
            G[r][c+1]='w';
            G[r][c+2]='b';
            P = mk(r,c+1);
            return ;
        }
    }
}

inline bool isComplete(int extraController) {
    bool nice=true;
    fo(i,R) {
        fo(j,C) {
            if ( tolower( G[i][j] ) == 'b' ) {
                if ( Q[i][j]!='+' ) {
                    nice=false;
                    goto L;
                }
            }
        }
    }
L:
    if ( nice==true || extraController==1 ) {
        fo(i,R) {
            fo(j,C) {
                if ( Q[i][j]=='+' ) {
                    if ( isalpha( G[i][j] ) ) {
                        M[i][j] = toupper( G[i][j] );
                    }
                    else {
                        M[i][j] = Q[i][j];
                    }
                }
                else {
                    M[i][j] = G[i][j];
                }
            }
        }
    }
    return nice;
}
inline void Proc() {
    pair<int,int> worker = findWorker();
    
    
    bool nice=false;
    fo(i,LN(command)) {
        if ( command[i]=='U' ) {
            moveU(worker);
        }
        else if ( command[i]=='D' ) {
            moveD(worker);
        }
        else if ( command[i]=='L' ) {
            moveL(worker);
        }
        else if ( command[i]=='R' ) {
            moveR(worker);
        }
        if ( !nice && isComplete(0) ) {
            nice=true;
        }
    }
    if ( nice==true ) {
        cout<<"Game "<<kase<<": complete\n";
    }
    else {
        cout<<"Game "<<kase<<": incomplete\n";
        isComplete(1);
    }

    fo(i,R) {
        fo(j,C) {
            cout<<M[i][j];
        }
        cout<<"\n";
    }


}

int main() {
    while ( scanf("%d %d",&R,&C)==2 ) {
        if ( R==0 && C==0 ) {
            break;
        }
        Read();
        Proc();

        ++kase;
    }

    return 0;
}
// kate: indent-mode cstyle; space-indent on; indent-width 0; 
